package com.example.zhaojianxu.signin.securities.buy

import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.ViewGroup
import com.example.zhaojianxu.signin.R
import com.example.zhaojianxu.signin.securities.http.BuyEntity

/**
 * create by @zhaojianxu on 2019/2/17
 */
class BuyAdapter(var mList: MutableList<BuyEntity>) : RecyclerView.Adapter<BuyViewHolder>() {

    override fun onCreateViewHolder(p0: ViewGroup, p1: Int): BuyViewHolder {
        return BuyViewHolder(LayoutInflater.from(p0.context).inflate(R.layout.securities_item_buy, p0, false))
    }

    override fun getItemCount(): Int {
        return mList.size
    }

    override fun onBindViewHolder(p0: BuyViewHolder, p1: Int) {
        p0.setData(mList[p1])
    }

}